#include "PolygonMapItem.h"
#include "MapHandle.h"
#include "AbstractPolygonMapItem.h"

PolygonMapItem::PolygonMapItem(MapItemType::Type type/* = MapItemType::Polygon */)
: AreaMapItem(type)
{

}

PolygonMapItem::PolygonMapItem(const QVector<QPointF>& points, MapItemType::Type type /* = MapItemType::Polygon */)
: AreaMapItem(type)
{
	setPoints(points);
}

void PolygonMapItem::setPoints(const QVector<QPointF>& points)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->setPoints(points);
}

void PolygonMapItem::addPoint(const QPointF& point)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->addPoint(point);
}

void PolygonMapItem::removePointByIndex(int index)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->removePointByIndex(index);
}

void PolygonMapItem::addPoints(const QVector<QPointF> &points)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->addPoints(points);
}

const QVector<QPointF> & PolygonMapItem::getPoints() const
{
	return dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->getPoints();
}

void PolygonMapItem::setPointVisible(bool pointVisible)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->setPointVisible(pointVisible);
}

bool PolygonMapItem::getPointVisible() const
{
	return dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->getPointVisible();
}

void PolygonMapItem::setPointSize(int pointSize)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->setPointSize(pointSize);
}

int PolygonMapItem::getPointSize() const
{
	return dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->getPointSize();
}

void PolygonMapItem::setPointColor(const QColor& pointColor)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->setPointColor(pointColor);
}

const QColor& PolygonMapItem::getPointColor() const
{
	return dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->getPointColor();
}

void PolygonMapItem::setPointStyle(PointStyle::Style pointStyle)
{
	dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->setPointStyle(pointStyle);
}

PointStyle::Style PolygonMapItem::getPointStyle() const
{
	return dynamic_cast<AbstractPolygonMapItem*>(d_ptr)->getPointStyle();
}

PolygonMapItem::~PolygonMapItem()
{

}